package com.wuchao.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
//
import javax.validation.constraints.*;
import java.util.Date;

/**
 * @Author wuchao66
 * @Date 2023/8/8 10:57
 * @PackageName:com.wuchao.entity
 * @ClassName: Entry
 * @Description: TODO
 * @Param
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Entry {//toString()
    private int id;
    @Max(value = 5,message = "对不起分类id最大是5")
    @Min(value = 1,message = "对不起分类id最小是1")
    private int categoryId;
    @NotNull(message = "对不起不能为空")
    private String title;
    @NotNull
    @NotBlank
    private String summary;
    private String uploaduser;
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern= "yyyy-MM-dd")
    private Date createdate;
    private int deleted;
    //@Max(10)
    private int version;
    //注入小表充当属性

    private Category category;

}
